package org.itheima56.weidget;

import android.os.Bundle;
import android.app.Activity;
import android.graphics.Color;
import android.view.Menu;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;

public class MainActivity extends Activity
{

	private LinearLayout	container;

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		container = (LinearLayout) findViewById(R.id.main_container);

		// 业务逻辑 ---> 数据

		container.setOrientation(LinearLayout.VERTICAL);

		LinearLayout.LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
		params.weight = 1;
		// 上面
		LinearLayout topLayout = new LinearLayout(this);
		topLayout.setBackgroundColor(Color.RED);
		container.addView(topLayout, params);

		// 给上面一部分去加view
		

		// 下面
		LinearLayout bottomLayout = new LinearLayout(this);
		bottomLayout.setBackgroundColor(Color.BLUE);
		container.addView(bottomLayout, params);
	}

}
